package com.wlhse.dao;

import com.wlhse.dto.inDto.TaskManagementDto;
import com.wlhse.entity.TaskCheckPersonsPojo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TaskDao {

    int addTask(TaskManagementDto taskManagementDto);

    //查01，BZH%20190129
    String queryOrderCode2(String OrderCode12);

    int deleteTask(@Param("id") Integer id);

    int updateTask(TaskManagementDto taskManagementDto);

    List<TaskManagementDto> queryTasks(@Param("isOrderBy") String isOrderBy, @Param("url") String url);

    //条件查询
    List<TaskManagementDto> queryTasksByCondition(@Param("issueDate1") String issueDate1, @Param("issueDate2") String issueDate2, @Param("status") String status, @Param("isOrderBy") String isOrderBy, @Param("leaderID") Integer leaderID, @Param("publishID") Integer publishID, @Param("currentDays") String currentDays, @Param("exceptStatus") String exceptStatus, @Param("url") String url);

    //查询任务total，为分页传参
    int queryTotal(@Param("issueDate1") String issueDate1, @Param("issueDate2") String issueDate2, @Param("status") String status, @Param("isOrderBy") String isOrderBy, @Param("leaderID") Integer leaderID, @Param("publishID") Integer publishID, @Param("currentDays") String currentDays, @Param("exceptStatus") String exceptStatus);

    //通过id查询详情
    TaskManagementDto queryTasksByID(@Param("id") int id, @Param("isOrderBy") String isOrderBy, @Param("leaderID") Integer leaderID, @Param("publishID") Integer publishID, @Param("url") String url);

    //增加任务的检查人员
    int addTaskCheckPersonsPojo(TaskCheckPersonsPojo taskCheckPersonsPojo);

    //查询个人接受的任务
    List<TaskManagementDto> queryTasksByPublishPerson(@Param("checkPersonsID") Integer checkPersonsID, @Param("status") String status, @Param("isOrderBy") String isOrderBy, @Param("issueDate1") String issueDate1, @Param("issueDate2") String issueDate2, @Param("url") String url);

    //修改个人任务的状态
    int updateTaskCheckPersonsStatus(@Param("taskCheckPersonsID") Integer taskCheckPersonsID, @Param("status") String status, @Param("taskID") Integer taskID);

    //计数
    int countByStatus(@Param("status") String status, @Param("taskID") Integer taskID);

    TaskManagementDto queryTasksByPublishPersonByID(@Param("taskCheckPersonsID") int taskCheckPersonsID, @Param("url") String url);

    //获取员工名
    String getPersonName(@Param("empID") Integer empID);

    //个人接受的任务计数，用于分页
    int queryTotalTasksByPublishPerson(@Param("checkPersonsID") Integer checkPersonsID, @Param("status") String status, @Param("isOrderBy") String isOrderBy, @Param("issueDate1") String issueDate1, @Param("issueDate2") String issueDate2);

    TaskManagementDto queryTasksByPlanId(@Param("planId") Integer planId);

    Integer queryTaskCount(@Param("hashCode") int hashCode);

}
